package com.zq.zhufengfm.entity.discoverrecommened;

/**
 * Project_name : ZhuFengFM
 * Author : zhaoQiang
 * Date : 2015/10/21,11:35
 * Email : zhaoq_hero@163.com
 */

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.LinkedList;
import java.util.List;

/**
 * 精品听单的推荐  内部包含多个听单信息
 */
public class DiscoverRecommendSpecial extends DiscoverRecommendItem{

    private List<SpecialItem> specialItems;


    @Override
    public void parseJSON(JSONObject jsonObject) throws JSONException {
        super.parseJSON(jsonObject);
        if (jsonObject != null) {


            JSONArray list = jsonObject.getJSONArray("list");

            if (list.length()>0) {
                //TODO 解析 List
                specialItems = new LinkedList<SpecialItem>();

                for (int i = 0; i < list.length(); i++) {
                    JSONObject jsonObj = list.getJSONObject(i);
                    SpecialItem item = new SpecialItem();

                    item.parseJSON(jsonObj);

                    specialItems.add(item);

                }

            }
        }
    }

    public List<SpecialItem> getSpecialItems() {
        return specialItems;
    }
}
